package cn.iocoder.yudao.module.promotion.redpacket.service.admin;

import cn.iocoder.yudao.framework.business.basic.dao.query.CoreQueryWrapper;
import cn.iocoder.yudao.framework.business.basic.service.PageService;
import cn.iocoder.yudao.framework.business.basic.service.impl.BaseService;
import cn.iocoder.yudao.module.promotion.redpacket.dao.RedPacketRecordMapper;
import cn.iocoder.yudao.module.promotion.redpacket.pojo.dto.RedPacketRecordQueryDTO;
import cn.iocoder.yudao.module.promotion.redpacket.pojo.po.RedPacketRecord;
import cn.iocoder.yudao.module.promotion.redpacket.pojo.vo.RedPacketRecordVO;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 服务
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/06/21
 */
@Service
public class RedPacketRecordService extends BaseService<RedPacketRecord, RedPacketRecordVO, RedPacketRecordQueryDTO> implements PageService<RedPacketRecordVO, RedPacketRecordQueryDTO> {
    @Resource
    private RedPacketRecordMapper redPacketRecordMapper;

    @Override
    public RedPacketRecordMapper getInjectedMapper() {
        return redPacketRecordMapper;
    }

    @Nonnull
    @Override
    protected CoreQueryWrapper<RedPacketRecord> buildQueryWrapper(RedPacketRecordQueryDTO param) {
        CoreQueryWrapper<RedPacketRecord> wrapper = super.buildQueryWrapper(param);
        wrapper.eqIfPresent("shop_id", param.getShopId());
        wrapper.eqIfPresent("source", param.getSource());
        return wrapper;
    }

}
